package org.zcl.model;

import org.zcl.enums.CacheKeyEnum;

/**
 * @Package org.zcl.util
 * @PROJECT_NAME: question
 * @DESCRIPTION:
 * @USER: zhuchenglin
 * @DATE: 2021/12/24 14:07
 */
public class CacheKey {

    public static String getKey(CacheKeyEnum userCacheKeyEnum, Object... values) {
        StringBuilder stringBuilder = new StringBuilder(CacheKey.class.getName() + "_" + userCacheKeyEnum.getKeyPrefix());
        for (int i = 0; i < values.length; i++) {
            if (i != values.length - 1) {
                stringBuilder.append(values[i]).append("_");
            } else {
                stringBuilder.append(values[i]);
            }
        }
        return stringBuilder.toString();
    }
}
